package com.example.controller;

import com.example.service.PredictionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController

public class PredictionController {

    @Autowired
    private PredictionService predictionService;
    private static final Logger logger = LoggerFactory.getLogger(PredictionController.class);



    @GetMapping("/predict")
    public double predict(@RequestParam String nationClass) {
        logger.info("Predicting score for nationClass: {}", nationClass);
        return predictionService.predictScore(nationClass);
    }
}
